<?php

namespace app\validate;

use app\base\BaseValidate;

/**
 * 验证器-GoodsNavbarValidate
 * Class GoodsNavbarValidate
 * @package app\validate
 */
class GoodsNavbarValidate extends BaseValidate
{

    protected $rule = [
        'id' => 'require|number',
        'sort' => 'require|number',
        'status' => 'require|number',
        'name|导航分类名称' => 'require',
        'icon|图标不能为空' => 'require',
    ];


    //验证场景-更新
    public function sceneUpdate()
    {
        return $this->only(['id', 'name']);
    }

    //验证场景-上线状态
    public function sceneUpStatus()
    {
        return $this->only(['id', 'status']);
    }


    //验证场景-添加
    public function sceneAdd()
    {
        return $this->only(['name']);
    }
}
